Here are examples with restrictions on peak heights and valley heights Let a(n) be the number of Motzkin paths of length n The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 2 P x + P x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 1, 2, 4, 9, 21, 51, 127, 323, 835, 2188, 5798, 15511, 41835, 113634, 310572, 853467, 2356779, 6536382, 18199284, 50852019, 142547559, 400763223, 1129760415, 3192727797, 9043402501, 25669818476, 73007772802, 208023278209, 593742784829, 1697385471211, 4859761676391, 13933569346707, 40002464776083, 114988706524270, 330931069469828, 953467954114363, 2750016719520991, 7939655757745265, 22944749046030949, 66368199913921497, 192137918101841817, 556704809728838604, 1614282136160911722, 4684478925507420069, 13603677110519480289, 39532221379621112004, 114956499435014161638, 334496473194459009429, 973899740488107474693, 2837208756709314025578, 8270140811590103129028, 24119587499879368045581, 70380687801729972163737, 205473381836953330090977, 600161698382141668958313, 1753816895177229449263803, 5127391665653918424581931, 14996791899280244858336604, 43881711243248048262611670, 128453535912993825479057919, 376166554620363320971336899, 1101997131244113831001323618, 3229547920421385142120565580, 9468017265749942384739441267, 27766917351255946264000229811, 81459755507915876737297376646, 239056762740830735069669439852, 701774105036927170410592656651, 2060763101398061220299787957807, 6053261625552368838017538638577, 17785981695172350686294020499397, 52274487460035748810950928411209, 153681622703766437645990598724233, 451929928113276686826984901736388, 1329334277731700374912787442584082, 3911184337415864255099077969308357, 11510402374965653734436362305721089, 33882709435158403490429948661355518, 99762777233730236158474945885114348, 293804991106867190838370294149325217, 865461205861621792586606565768282577, 2549948950073051466077548390833960154, 7514646250637159480132421134685515996, 22150145406114764734833589779994282345, 65303054248346999524711654923215773701, 192564948449128362785882746541078077821, 567944426681696509718034692302003744197, 1675395722976475387857861526496400455935, 4943221572052274428484817274841589781103, 14587540897567180436019575590444202957764, 43055804394719442101962182766220627765254, 127103430617648266466982424978107271745123, 375281510930976756310181851730346874521559, 1108229819877900763405338193186744667723583, 3273209089476438052473101825635320104642103, 9669131152389329200998265687814683780583133, 28567321136213468215221364999058944720713501, 84414794291793480358891042199686850901302514, 249478578991224378680142561460010030467811580, 737415571391164350797051905752637361193303669] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No peak can belong to {1} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 4 2 4 2 3 2 2 2 3 5 2 1 2 1 x P - - P x + - P x + P x - - P x + P x + - x - - P 3 3 3 3 3 2 1 - - x + - = 0 3 3 Here are the terms a(n) from n=0 to n=100 [1, 1, 1, 1, 2, 6, 18, 50, 133, 349, 919, 2443, 6559, 17759, 48417, 132765, 365883, 1012827, 2814975, 7852359, 21977172, 61697208, 173688720, 490222392, 1386896799, 3932313671, 11172152779, 31801604227, 90683754826, 259017103918, 740970165478, 2122781434478, 6089823353307, 17493018434427, 50309974998299, 144858482943643, 417549264239326, 1204816744444234, 3479854728938302, 10060211466240958, 29109819628876895, 84302455718407239, 244338768713037369, 708729071251002045, 2057259720889665651, 5975926532735604171, 17370636526181495613, 50525250146405293929, 147052393355564243517, 428248558258622354877, 1247871400947677387289, 3638181483837212518545, 10612813182957146862708, 30974180946939144548400, 90444938986128945707280, 264226417806831665062008, 772268867259419632282173, 2258157894649392364477653, 6605825219984474009750319, 19332173153165597958044355, 56599061139243471807548823, 165770459567550405815947479, 485701106384426111189425593, 1423606629694287014199557589, 4174120877887577827364793651, 12243047181322448451751207347, 35921882081390493459473403363, 105431277928924778170857453891, 309539900267354604656780379534, 909068710673840849331410620410, 2670582334843236575591928361326, 7847672376408548992466106382062, 23067364098173951259734533247631, 67822534371168724385961288122775, 199464607677966302055298092723669, 586773435903636236984058372180945, 1726572815323193116935413598214677, 5081669465723744677970236543002165, 14960024219784179818865503698293163, 44051424610172284076801358016145279, 129743885927950859431229636005076833, 382217635381452116281427696663308993, 1126235206599315479287363716042362845, 3319248738302791954434551346482701333, 9784545594163359310261205069630463652, 28848922924249845456459031368493237808, 85075520136529216183172768369861186520, 250936447902577056017147416758514197456, 740295524631465653363373125178972137813, 2184373653799575803944589582295569286157, 6446550758871506611298020760451392291341, 19028513122862327345883081577546336468861, 56176881470305676124357949532470694086900, 165876220301517693968980868968798362868792, 489872232714374632377403270990969779820028, 1446945615302279364787638884024830837195116, 4274554278190173710737872976428601124171445, 12629824093882552307143255351352404624644885, 37322458356357780612902990182753730183261925, 110308336343817175853882018368326490122516549, 326069589003352217686238463978674460549631722] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No peak can belong to {1,2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 22 5 2 4 2 9 5 32 2 3 29 4 18 2 2 - -- x P + 5 x P + - x P - -- P x - -- x P + -- P x 7 7 7 7 7 3 3 4 6 2 34 2 10 3 1 2 15 + 6 P x + - x - - x P - -- P x - -- x + - P + -- P x 7 7 7 7 7 7 13 2 3 8 2 6 2 + -- x - - P - - x + - + x P = 0 7 7 7 7 Here are the terms a(n) from n=0 to n=100 [1, 1, 1, 1, 1, 1, 2, 8, 31, 103, 307, 859, 2330, 6254, 16806, 45454, 123899, 340171, 939594, 2607960, 7267835, 20323487, 57004817, 160334565, 452120352, 1277952776, 3620256932, 10276923148, 29229814152, 83286211832, 237713498630, 679551341962, 1945523598885, 5577740589829, 16012264818320, 46024368323270, 132444553421994, 381561420355874, 1100408331649881, 3176721842118659, 9179498447008411, 26549309606464395, 76853471658861185, 222655002631611805, 645571006275418873, 1873195515327112441, 5439207644113088064, 15804777811388948258, 45954599057082376346, 133704415446078831418, 389249210578305551701, 1133873567344026788123, 3304811456836268125446, 9637507295632904761866, 28119658586943791673937, 82087011071994247205459, 239745319485139802786770, 700534862785762557689514, 2047888439012254359212093, 5989259313469575530416859, 17523623235272984871862940, 51292357328968918838858832, 150194370717632754719765165, 439968364056834867175006235, 1289290693706226983375443871, 3779522152404771411532716319, 11083447289969142767057411683, 32513237948052548058339284459, 95408849627282716340972630500, 280063193030859673009599599592, 822353211561617714994467273398, 2415415993032857046048038804002, 7096644248674289844415591763102, 20856344801454207194658734254558, 61311802136376006592118542798676, 180288270530493292865463342786096, 530280045940206050418845187499651, 1560107601281317976247557107494999, 4591054230671789494925216395340884, 13513758397819493108725922317170594, 39787173981613380886314050791664579, 117168455853510412046806280294359219, 345125094635790233072949879204538315, 1016806295276176540163142067248060955, 2996356545074031121687931603505956957, 8831615046077135815771897131256908869, 26036105684285996862002593732479762482, 76771340808323479114150741984986215104, 226416175603248906908144872508092302323, 667880997280261568585786677662251619179, 1970480700294795591083017745995710899751, 5814668462156846028015720002460842696463, 17161516881421805917178621529182729280592, 50659704723485284498202307925578032954636, 149569927323904398198296111681109064740582, 441671104186707014353458463270543848405690, 1304443418035688607866083765952132509860058, 3853200291527364894671337332992273073103962, 11383782088551211379113166112742867906257392, 33637121777417643317569399560696349366466908, 99407007692298585221445390813403414543236731] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No valley can belong to {1,2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 8 1 2 68 6 20 7 2 11 8 8 2 9 - - x + - P - -- x P + -- x P + -- x P - 7 x P - x P 3 3 3 3 3 2 9 2 10 2 56 3 70 4 28 2 2 1 + - x P + x P - -- x + -- x + -- x - - P + - 3 3 3 3 3 3 128 5 2 167 5 4 10 2 43 6 2 56 5 - --- x P + --- x P - 69 x P - -- x P + -- x P - -- x 3 3 3 3 3 28 6 8 7 1 8 152 4 2 104 2 3 43 2 2 + -- x - - x + - x + --- x P - --- P x + -- P x 3 3 3 3 3 3 154 3 70 2 + --- P x - -- P x + 6 P x = 0 3 3 Here are the terms a(n) from n=0 to n=100 [1, 1, 2, 4, 9, 21, 50, 120, 289, 697, 1683, 4071, 9873, 24025, 58695, 144027, 355076, 879700, 2190653, 5484351, 13806248, 34954932, 89022776, 228097832, 588060904, 1525603496, 3982882887, 10463767789, 27662479307, 73580772523, 196900515183, 529981611063, 1434544000229, 3903929581989, 10678545336315, 29351152603367, 81043602286533, 224734363006413, 625684323080162, 1748465043463696, 4902975600936542, 13792856192500638, 38916796597728435, 110106153573743429, 312311285863395366, 887936720001921402, 2529984448242454883, 7223118745727466313, 20660379392641778075, 59196994080906257115, 169885086001022383666, 488265816681025929328, 1405265856339512501758, 4049686830247974475966, 11684455336440912701636, 33750966612854821524280, 97594259433254143310878, 282484706141115181221774, 818413774479326135490053, 2373204337248251019417883, 6887480682297757046082008, 20004574253007408109049916, 58146566062205867051122506, 169132968783991502143317366, 492296551855816552744837608, 1433856435369648810683732328, 4178803713919108947914678405, 12185790617482721593573200639, 35554923570778033267579667144, 103795784661707980122931704260, 303168407383672002793172535572, 885938127840462158830914722540, 2590178010698135913573333650593, 7576256572200034207296667151753, 22170277756323749665035142672722, 64904079151981044530338230317756, 190086228990759104854698713451038, 556930370183065211509514164597182, 1632363424644731182868332528275717, 4786223328653955007768421007727255, 14038604829397276362622597231234889, 41191236960201839343313359800151241, 120901273103257772667597412151603772, 354974834841558233647633217881655250, 1042558956766635349390775096826444893, 3062922204554680605786595651175411265, 9001185299187685203704701004134735941, 26459895116591941975980863597871323749, 77803237361336604389907528535905955117, 228836323323837941312051442717349059501, 673235106413566505086820402270176584621, 1981161784240370898926529698591304309421, 5831517028786995615963435625509684329130, 17169147020454468611843340013055946600342, 50561356634783001421180058822007128670505, 148932306389308557265811996346833388236491, 438790063516961869196030277566531343090299, 1293063632573100118040592638525133873254843, 3811324423933132466712891467678149762901545, 11236281151170828440431450930412670150161733, 33132771869629911606378329421445941319605270] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No peak can belong to {1} and no valley can belong to {1} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 6 2 5 2 4 5 2 3 4 2 2 P x - 2 P x + 9 P x + P x - 16 P x - 7 P x + 14 P x 3 4 2 2 3 2 2 + 17 P x + x - 6 P x - 19 P x - 4 x + P + 10 P x + 6 x - 2 P - 4 x + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 1, 1, 1, 2, 6, 17, 43, 102, 238, 563, 1365, 3387, 8555, 21900, 56682, 148159, 390831, 1039770, 2787776, 7527162, 20453002, 55894024, 153538732, 423745245, 1174465941, 3267834678, 9124676800, 25561276789, 71819005993, 202341405518, 571513428396, 1618012567914, 4590680722282, 13051050502529, 37172950458127, 106063891075052, 303122321042952, 867627899209716, 2486988145214804, 7138409771477266, 20515536806279298, 59031914291371982, 170053221224462630, 490400134195566162, 1415662604154127682, 4090627894436051863, 11830972791148959549, 34247740674566967173, 99221656287738271589, 287691753049153235826, 834793752910323845500, 2424081822698421077695, 7043979339734988550355, 20482306110583306281592, 59596076182661971370830, 173509514965459537657394, 505458130453255487816514, 1473307507720585494926619, 4296735029172727605262277, 12537526246015760746646896, 36602006544556304833643372, 106907896929486239675072728, 312405770622156186350976120, 913325503095291636801079534, 2671300033332818815355049070, 7816348459011430664913491899, 22880380401202318061774509205, 67003097186987467440855751195, 196287808525025746804604902859, 575245653455188422247764997510, 1686436298722693665093389632408, 4945820453087623603464791194401, 14509552183003623575572297224665, 42580678700917651440187965201451, 124999967248203938580961438754351, 367064165165879491285430194869121, 1078214173174391462694196750012649, 3168074548465739236396483541118817, 9311283653200936472207988786666369, 27374372490843847923057662288898903, 80500025358081462188670989388523831, 236789257995524096347737398327528769, 696689295596833415886231417268573493, 2050333853787873165880151641714995321, 6035532346287327961181677736419566777, 17770902739965355380014999395791752111, 52336389638989655805723586302951753459, 154168603519040988376188026621570930467, 454238206989984025857653810557067109315, 1338642618434812523578509107231276866694, 3945814819468277857701226620005518075796, 11633159833490892021884108009757750496066, 34304064930616718751458518180247058519426, 101176206747306991243633563061630628723778, 298465546617364653251924025686478596580498, 880625335376617819817955169221065937653595, 2598768042135876336180051175019424748413115, 7670461641356018133200006867505501807070700, 22643912013919053876207707130055003840518254, 66858367440116306567682983630616315083306937] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No peak can belong to {1,2} and no valley can belong to {1} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 1 2 2 20 3 4 5 1 6 1 - - P + - P - 2 x + 5 x - -- x + 5 x - 2 x + - x + - 3 3 3 3 3 8 2 14 8 2 41 2 2 2 65 3 + x P + -- P x - - x P - -- P x + 9 P x + -- P x 3 3 3 3 50 2 3 62 4 4 2 38 5 44 5 2 6 - -- P x - -- x P + 19 x P + -- x P - -- x P - 5 x P 3 3 3 3 25 6 2 7 10 7 2 + -- x P + x P - -- x P = 0 3 3 Here are the terms a(n) from n=0 to n=100 [1, 1, 1, 1, 1, 1, 2, 8, 31, 103, 306, 848, 2260, 5916, 15426, 40406, 106755, 284819, 766907, 2081451, 5686782, 15622970, 43121854, 119511934, 332445960, 927872056, 2597765816, 7293893656, 20534230654, 57953022118, 163937252633, 464744599619, 1320149708277, 3757047134197, 10711057105337, 30586692803905, 87478970129133, 250556667926525, 718626102818511, 2063769919048603, 5934034378833276, 17082088039264068, 49227498102643366, 142012388350829706, 410084993393826732, 1185304210700064276, 3429056721175445258, 9928652719008716494, 28771328370757722862, 83438731223803069486, 242158051204231913392, 703298626392443323412, 2043983135631623287542, 5944281473742004869518, 17297944708031312763598, 50367681082708614104446, 146744412414225519019624, 427773405490698153574296, 1247669434222970013544901, 3640912878975542264170071, 10630114518940464455949747, 31050946174871842328872395, 90743119289624428251161697, 265306348248034156222693301, 776014970533657901047776389, 2270778887567026122936124293, 6647463473395408571488401334, 19467392791081050693213120600, 57032835752730594443900257765, 167148449933186444472300516945, 490043981773449241291635003255, 1437203979511409084184371430579, 4216459561880397450538360377347, 12374263895145271344927078750691, 36326924000334129943118220828520, 106677242368420800967157170624474, 313361104346770494555037089982285, 920756844156961687008879326433881, 2706250113387348925918023924787866, 7956291892871926220778482330115200, 23397534957880821316959506700396382, 68824500690233538586546035064135390, 202500763802501262150870134938246627, 595961315656486367699529744534708157, 1754343233697487230200484321952371092, 5165513938533744394408555691413567256, 15212915943299363662164201058466383961, 44813505960713804548062380874645214807, 132038495290074442283249073471905894246, 389121423110379472431761048083083085118, 1146992212476810635597215543117074987785, 3381617225010551544780562916398669833463, 9971834095925610191713668925876845826768, 29411034460720099909827126125203760647620, 86761752970440048169886417977033836282853, 255992514272535705378701432421866365781995, 755449382739368088833407334367274897782556, 2229774361078821302569490704706727066621244, 6582520891644126519080715395696026202020257, 19435590923399112200312851093297122307626763, 57395239297293282465996785633047227562271130] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No peak can belong to {1,2} and no valley can belong to {1,2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 10 2 9 2 8 9 2 7 8 P x - 4 P x + 30 P x + P x - 100 P x - 13 P x 2 6 7 8 2 5 6 7 + 195 P x + 62 P x + x - 246 P x - 158 P x - 8 x 2 4 5 6 2 3 4 5 + 209 P x + 247 P x + 28 x - 120 P x - 251 P x - 56 x 2 2 3 4 2 2 3 2 + 45 P x + 168 P x + 70 x - 10 P x - 72 P x - 56 x + P 2 + 18 P x + 28 x - 2 P - 8 x + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 1, 1, 1, 1, 1, 2, 8, 30, 94, 258, 650, 1558, 3654, 8571, 20417, 49782, 124390, 317521, 824183, 2166342, 5749114, 15377053, 41411271, 112226001, 305929041, 838554136, 2310177646, 6394063080, 17772219032, 49586901589, 138834325035, 389936112279, 1098338584151, 3101843788659, 8781165924139, 24914464427964, 70834639306816, 201776210559650, 575793053312838, 1645822115578371, 4711641950595755, 13508027724129822, 38779587784559628, 111473286081934763, 320820908925242519, 924377545137750092, 2666269368942826058, 7698423550904134310, 22249481480486382662, 64363139622321753114, 186352090812484382594, 539998989486993947466, 1566016883960003354058, 4544949875996857031633, 13200072798000909610635, 38364053945102963850197, 111573445395327832833557, 324693377304574689939918, 945477152695923785056984, 2754755968729710625635035, 8030818293395935298909815, 23424573936962568274133722, 68361254894644308426915852, 199602721973467449289440689, 583086700392545853130630769, 1704129572171006070254965525, 4982735574013840744888952797, 14575455374146831704534323354, 42653938772716465211041441710, 124874234177739006537347050647, 365727390979787537249847935685, 1071538139935609212690191164854, 3140639417716462138322789641614, 9208393343916553431606431376796, 27008487321263822036102692121720, 79243337715692480816520207783455, 232577150334859282874882944230051, 682824339790804602625913496154667, 2005324499623050883629245557001587, 5891016872021467217973191075243352, 17311001552887395331746643132829416, 50883500097364731138005646230201534, 149606783276145666841112543896080618, 439989108357041920182973169999969737, 1294332431368487295354463118500407557, 3808553501025005513905299685134654028, 11209384759830544710897970950268203758, 32999568133277426393723223852759543020, 97171046228829736133354459558382826892, 286197028328975055234407799051287016721, 843122247185952789775554110784965665459, 2484338804237772612098708018145324584798, 7321898139093774142383166319845021374682, 21583752375026146555765113264860332866898, 63638292944810217897371410215507308055322, 187670654214440481003705433715249157953786, 553552133307061118646505342933622480238330, 1633063642152702865682812928402975803627082, 4818682152995716236322756812147417299470570, 14221069875329253960660261055998711787883646] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No peak can belong to {2} and no valley can belong to {1,2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 10 2 9 2 8 9 2 7 8 2 6 P x + 2 P x - 5 P x - P x - 12 P x + P x + 71 P x 7 8 2 5 6 7 2 4 + 20 P x + x - 140 P x - 88 P x - 8 x + 154 P x 5 6 2 3 4 5 2 2 + 177 P x + 28 x - 104 P x - 209 P x - 56 x + 43 P x 3 4 2 2 3 2 + 154 P x + 70 x - 10 P x - 70 P x - 56 x + P + 18 P x 2 + 28 x - 2 P - 8 x + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 1, 2, 4, 8, 16, 33, 71, 159, 367, 864, 2058, 4936, 11896, 28802, 70110, 171783, 424151, 1056310, 2654852, 6735578, 17249914, 44584457, 116255939, 305702172, 810273476, 2163733779, 5818380553, 15747630253, 42878190005, 117399492550, 323082844100, 893304135073, 2480584510593, 6915469286285, 19348994592357, 54316621781552, 152941400845660, 431844052448928, 1222476331025984, 3468784484036871, 9864112143261151, 28106769374502185, 80236442699252221, 229446882359750815, 657188679658637895, 1885159690019314964, 5415189187228437370, 15575708822659640681, 44855484472228512153, 129325704978606889144, 373273000606169712230, 1078484948292993662668, 3119054741280579284268, 9028818450917131035238, 26158767042365098526482, 75851306798935009653931, 220115577733414888503811, 639240340554570910115732, 1857753966944883242525022, 5402675149827737222800229, 15722192799096851102375857, 45781374696488901131862538, 133390417195712234131467120, 388874879543906035207798644, 1134317511072566926840211188, 3310468891080371487350107850, 9666421105752674308728692726, 28239366263035969012401977801, 82537137212274432307158105637, 241346884194684211071707505292, 706032763892711966192740345726, 2066294765131821084679657355888, 6049753805551255751966010081904, 17719652461552364137695513331785, 51920532354642589989831048271075, 152189313535347656650477302709007, 446257132219180206506585891052583, 1308992996507538240294776822890554, 3840926478864312679648867770632708, 11273967414033512022629770439221820, 33102093231597398135027676455718172, 97222776741937070786636053957618662, 285634472865969032226624449834770458, 839420517584446905576369077370004968, 2467580777199302011918494384308424816, 7255755534462915666877225471733339107, 21340772524618547952800694566436571093, 62784257221223929192676854093882734707, 184757269861506461316260046708724751315, 543825544090771084705963390784455068291, 1601113845184531062166925713665755289283, 4715054568001863911752704313408667360933, 13888348043368394184873604666494959755997, 40917714737973223070783610438297065456037, 120577618799328377352699416575224642711205, 355397459406650510532810782967281898071441, 1047736391640996497088314241247787793205265, 3089425462074375707567082176721070086267374, 9111489104107471796113170856438256679893384, 26877259118730436567794160601003858992207082] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No peak can belong to {2,5} and no valley can belong to {3,6,9} The generating function P(x) of the sequence a(n) satisfies the algebraic equation FAIL Cannot find the equation from the first 101 terms of the sequence Here are the terms a(n) from n=0 to n=100 [1, 1, 2, 4, 8, 16, 33, 71, 160, 376, 913, 2267, 5707, 14483, 36932, 94482, 242319, 622847, 1604209, 4139797, 10702790, 27719242, 71912305, 186869251, 486366864, 1267836056, 3309930595, 8653998385, 22659160270, 59413903730, 156005137899, 410191272865, 1079994536288, 2847317479552, 7516601421658, 19868769868814, 52586851459412, 139358444405468, 369770948334578, 982356919739782, 2612983531985368, 6958711682792584, 18554100839990452, 49529517122435340, 132371873051422577, 354184226686425645, 948766113069894479, 2544369922860748275, 6831047686139742457, 18360112897382675161, 49401428370652897622, 133068463883859994880, 358820969920863803315, 968597409722862289415, 2617385116185602354249, 7080225234020871294653, 19172475772960622129104, 51970614574444799160024, 141020807652222646976487, 383046689211126775085085, 1041504644655165477344732, 2834717903782954350676216, 7723179427653570622151150, 21062935874398955794258138, 57501266365898693520167710, 157134380112754023277282078, 429833506917899595244891250, 1176968545901741413851776538, 3226009413519347249259705189, 8851228948474772943077413553, 24309722704251112908676260134, 66833861370364814191134730860, 183931092801256111574914962125, 506708289724191895209440179173, 1397357719469010535564448727254, 3857506117237558636479490171984, 10660019467211809229868931998260, 29489323835521564950512242003500, 81663937509586064276542639045177, 226390323369823417832519257857135, 628276600409778887095727928482579, 1745471957900537751203761152144115, 4854531502199958300540306694315903, 13516295804048891158784571928420439, 37674487790087435338827627204746654, 105128291582718017164495649497405194, 293682158800520440763735174416821402, 821342245222895986662732510762121922, 2299651893397376602071414166735653396, 6446052133947215052067394794267727556, 18089286043112564982073221120184202906, 50821411239141907594726644747170559926, 142945702578753836252268702913901715286, 402527517839367981076092482250536037318, 1134803590703530290732768610735686075323, 3202923663793638024183384867937887459185, 9050506015099632887743882322384026716464, 25603459372511148188106135319269501168528, 72514117201598405995524582477099242267193, 205609275178758412226616803676389513053227, 583655560704594153493798882878592904411576] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No valley can belong to {2,4,6,8,10} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 11 22 74 22 2 23 4 23 2 59912 14 2 -- x P - -- x P + x P - - x P + ----- x P 3 3 3 3 9328 15 17584 15 2 16 15431 16 2 + ---- x P - ----- x P + 5020 x P - ----- x P 3 3 3 8780 17 13496 17 2 7 24125 8 9 - ---- x P + ----- x P - 12064 x + ----- x + 2574 x 3 3 3 34684 10 31304 11 12 108212 11 2 - ----- x + ----- x - 1512 x + ------ x P 3 3 3 29792 12 38716 12 2 53216 13 13 2 + ----- x P - ----- x P + ----- x P - 14912 x P 3 3 3 1 22 1 2 220 2 3 4 5 6 + - x + - P + --- x - 440 x + 1757 x - 4874 x + 9424 x 3 3 3 14 482 2 263 2 2 3038 3 1738 3 2 - 18224 x P - --- x P + --- x P + ---- x P - ---- x P 3 3 3 3 12782 4 7690 4 2 5 23824 5 2 - ----- x P + ---- x P + 12502 x P - ----- x P 3 3 3 77164 6 52064 6 2 106352 7 7 2 - ----- x P + ----- x P + ------ x P - 25712 x P 3 3 3 8 64742 8 2 9 4256 9 2 - 26558 x P + ----- x P - 5278 x P + ---- x P 3 3 113528 10 88694 10 2 119236 11 46 + ------ x P - ----- x P - ------ x P + -- x P 3 3 3 3 1073 18 2 1558 19 19 2 20 - ---- x P + ---- x P - 846 x P - 67 x P 3 3 785 20 2 21 148 21 2 518 18 2 + --- x P - 31 x P + --- x P - --- x P - 8 x P 3 3 3 24 2 22 2 1 18 176 19 20 21 + x P - -- x - - P + - + 88 x - --- x - x + 2 x 3 3 3 3 14480 13 11392 14 512 15 3178 16 1148 17 - ----- x + ----- x - --- x - ---- x + ---- x = 0 3 3 3 3 3 Here are the terms a(n) from n=0 to n=100 [1, 1, 2, 4, 9, 21, 51, 127, 322, 826, 2136, 5556, 14518, 38078, 100186, 264306, 698901, 1851845, 4915515, 13068391, 34792957, 92750277, 247537577, 661338321, 1768574623, 4733754031, 12680610971, 33993819187, 91192917784, 244794845444, 657512887395, 1767054155885, 4751420296709, 12782355761605, 34403241371144, 92635427843054, 249536127914778, 672447684427250, 1812772506904896, 4888544203123988, 13187412176845605, 35585768980397997, 96055747489652802, 259354961650014852, 700461707472664471, 1892290084608204931, 5113281891445983192, 13820254808470259190, 37362211600881334824, 101028880529383057896, 273244523022462635054, 739174787624907236634, 1999998333635521822823, 5412479095978986600731, 14650231080733612884240, 39661772756808721384662, 107393290075375252524805, 290842409499828973893373, 787793265716285406389757, 2134220641120166728036557, 5782793151664948429376431, 15671344067900389383898535, 42476059266746372511648724, 115146540902653582206642250, 312194883088254818928490945, 846581071120821312369936385, 2296038030785654473275474140, 6228126067302821609486301394, 16896771592066218267542679957, 45847800561385226418637171721, 124423472054685590287248691749, 337719361736262916426958335221, 916812302445217898174273903226, 2489298248680611867118967996066, 6760002777191366364421225658595, 18360812007702026061761112214525, 49878549830920025254793029828283, 135523549844748404936413849612651, 368296059807623471753917888295143, 1001067409327980205513340611949055, 2721550392749207672931230713094263, 7400471425575107424079730846084215, 20127775273695039189674500806069860, 54755694118477984193022779753249614, 148992357527835180779147308104978190, 405512539070031237793602979056891334, 1103964055642246540193178407245420113, 3006222063610360545445201076408419683, 8188572166337061865109283052644164301, 22311164046733227854074285075375776589, 60809237557376025302995565531189246346, 165789479344447248959171155720189724316, 452159567147440633317622662690163213665, 1233620506133729416165213593896711319285, 3366935447701752327695399006507270573335, 9193060822260483531036949116894764612763, 25111168961065412771388625575301277390281, 68622266496576319294147737866658410318473, 187613881426464558428378098294391039634303, 513189426192431054424043423870495115180587, 1404477830955012893157601423868935251203984]